package com.atguigu.mall.mallproduct.web;

import com.atguigu.mall.mallproduct.service.PmsSpuInfoService;
import com.atguigu.mall.mallproduct.vo.SkuItemVo;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.GetMapping;

/**
 * @author fuc
 * @create 2020-11-26
 */
@Controller
public class ItemController {

  @Autowired PmsSpuInfoService spuInfoService;

  /**
   * 展示当前sku的详情
   *
   * @param skuId
   * @return
   */
  @GetMapping("/{skuId}.html")
  public String skuItem(Long skuId) {
    SkuItemVo skuItemVo = spuInfoService.skuItem(skuId);
    System.out.println("准备查询skuId：" + skuId + "的详情");
    return "item";
  }
}
